
typedef struct{
	uchar message_type;
	long client_ip_addr;
	int length;
	long server_identifier;
	long lease_time;
	long subnet_mask;
	long router;
	long domain_name_server;
	uchar *domain_name;
} DHCP_INFO;


typedef struct{
    unsigned char op;
    unsigned char htype;
    unsigned char hlen;
    unsigned char hops;
    long xid;
    short secs;
    short flag;
    long ciaddr;
    long yiaddr;
    long siaddr;
    long giaddr;
    unsigned char chaddr[16];
    unsigned char sname[64];
    unsigned char file[128];
    unsigned char magic_cookie[4];
    unsigned char options[44];
    unsigned char end[10];
} DHCP_MESSAGE;

typedef struct{
	short src_port;
	short dest_port;
	short length;
	short check_sum;
} UDP_HEADER;

struct UDP_PACKAGE{
	UDP_HEADER header;
	DHCP_MESSAGE message;
};


struct UDP_PERSDO_PACKAGE{
    long src_ip;
    long dest_ip;
    unsigned char zeros;
    unsigned char protocal;
    unsigned char length;
    DHCP_MESSAGE message;
};

typedef struct {
	unsigned char ip_and_headlength;
	unsigned char service_level;
	short length;
	short identify;
	short label_and_offset;
	unsigned char    ttl;
	unsigned char protocal;
	short head_checksum;
	long src_ip;
	long dest_ip;
} IP_HEADER;

typedef struct {
	IP_HEADER header;
	struct UDP_PACKAGE udp;
} IP_PACKAGE;

typedef struct {
	unsigned short pre;
	unsigned char dest_mac[6];
	unsigned char src_mac[6];
	//unsigned char type[5];
	unsigned short protocal;
} MAC_HEADER;

typedef  struct {
	MAC_HEADER header;
	IP_PACKAGE ip;
} MAC_PACKAGE;

